uniform extern texture ScreenTexture;   
uniform extern texture AlphaTexture;
 
float time;
 
sampler ScreenS = sampler_state
{
    Texture = <ScreenTexture>;   
};  
 
sampler AlphaSampler = sampler_state
{
    Texture = <AlphaTexture>;   
};
 
float4 main(float2 texCoord: TEXCOORD0) : COLOR
{
    float4 Color = tex2D(ScreenS, texCoord); // Get colour of individual pixel
    float alphaLayerAlpha = tex2D(AlphaSampler, texCoord).a; // Get alpha of lighting layer
    Color = Color * alphaLayerAlpha; // multiply pixel colour by alpha value
    return Color; 
}
 
technique Lighting
{
    pass P0
    {
        PixelShader = compile ps_2_0 main();
    } 
}